package com.example.klinemqflink.job;

import com.example.klinemqflink.model.MarketData;
import org.apache.flink.streaming.api.functions.timestamps.BoundedOutOfOrdernessTimestampExtractor;
import org.apache.flink.streaming.api.windowing.time.Time;

public class MarketDataWatermarkStrategy extends BoundedOutOfOrdernessTimestampExtractor<MarketData> {

    public MarketDataWatermarkStrategy() {
        super(Time.seconds(5)); // Allow 5 seconds of out-of-order events
    }

    @Override
    public long extractTimestamp(MarketData marketData) {
        return marketData.getTimestamp();
    }
}
